<template>
	<view class="bg-white">
		
		<view class="padding solid" v-for="(item,index) in wageList" :key="index">
			<view class="flex justify-between align-center">
				<view>
					<view>
						{{ item.job_name }}
					</view>
					<view class="text-gray" style="font-size: 25rpx;">
						{{ item.update_time }}
					</view>
				</view>
				<view class="text-red">
					¥ {{ item.money }}
				</view>
			</view>
		</view>
		<VipMask></VipMask>
	</view>
</template>

<script>
	
	import VipMask from '../../../../components/VipMask.vue'
	
	export default{
		components: {
			VipMask
		},
		watch: {
			loading(newValue, oldValue) {
				if(newValue){
					uni.showLoading({
						title: '加载中'
					});
				}else{
					uni.hideLoading();
				}
			}
		},
		created() {
			// this.companyId = '2152'
			this.fatchData()
		},
		onReachBottom(){
			this.page += 1
			// 查看评论列表
			this.fatchData()
		},
		data() {
			return {
				loading: false,
				wageList: [],
				page: 1
			}
		},
		props: {
			companyId: {
				type: String,
				default: ''
			},
		},
		methods: {
			async fatchData(){
				this.loading = true
				let res = await this.$api.queryWage({
					key: this.$util.getKey(),
					company_id: this.companyId,
					page: this.page,
					uid: this.$util.getUid()
				})
				this.loading = false
				if(res && res.data && res.data.data){
					if(this.page == 1){
						this.wageList = res.data.data
					}else{
						this.wageList = this.wageList.cancat(res.data.data)
					}
				}
			},
		},
	}
</script>

<style>
</style>
